# 冒泡排序
test_list  =[3,5,4,6,9,0,2,5,8]
for i in range(len(test_list)):
    for j in range(len(test_list)-i-1):
        if test_list[j]>test_list[j+1]:
            test_list[j],test_list[j+1] = test_list[j+1],test_list[j]
print(test_list)

#选择排序
test_list2  =[3,5,4,6,9,0,2,5,8]
for i in range(len(test_list2)):
    min_value = test_list2[i]
    min_index = i
    for j in range(i,len(test_list2)):
        if test_list2[j]<min_value:
            min_value = test_list2[j]
            min_index = j
    if i !=min_index:
        test_list2[i],test_list2[min_index] = test_list2[min_index],test_list2[i]
print(test_list2)


